package exsun.jt808.data.jt809_data;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;


/**
 * 车辆管理
 *
 * @author zscat
 * @email 163@qq.com
 * @date 2020-12-24 13:40:36
 */
@Data
public class VehicleRegistrationInformation implements Serializable {
    private static final long serialVersionUID = 1L;

    //车牌号

    //    @ApiModelProperty(value = "车牌号", required = true, example = "鄂A28576")
    private String numberPlate;
    //车牌颜色
    @ApiModelProperty(value = "车牌颜色", required = true, example = "1")
    private Integer plateColor;
    private String plateColorName;
    //终端SIM卡号
    @ApiModelProperty(value = "SIM卡号", required = true, example = "123456789014")
    private String simId;
    //终端ID
    @ApiModelProperty(value = "终端ID", required = true, example = "123456789")
    private String terminalId;
    //车主姓名
    @ApiModelProperty(value = "车主姓名", required = true, example = "张三")
    private String ownerName;
    //联系电话
    @ApiModelProperty(value = "联系电话", required = true, example = "15968525463")
    private String contactNumber;
    //车主性别
    @ApiModelProperty(value = "车主性别", required = true, example = "1")
    private Integer ownerSex;
    private String ownerSexName;
    //终端型号
    @ApiModelProperty(value = "终端型号", required = true, example = "0")
    private Integer deviceModel;
    private String deviceModelName;
    //厂商编码
    @ApiModelProperty(value = "厂商编码", required = true, example = "987654321")
    private String vendorCode;
    //运营商名称
    @ApiModelProperty(value = "运营商名称", required = true, example = "武汉依迅北斗时空技术股份有限公司")
    private String operatorName;
    //公司名称
    @ApiModelProperty(value = "公司名称", required = true, example = "123456789123456789")
    private Long companyId;
    private String companyName;
    //驾驶员一姓名
    @ApiModelProperty(value = "驾驶员一姓名", required = true, example = "张三")
    private String driverNameOne;
    //驾驶员一电话
    @ApiModelProperty(value = "驾驶员一电话", required = true, example = "15365487598")
    private String driverContactNumberOne;
    //驾驶员二姓名
    @ApiModelProperty(value = "驾驶员二姓名", required = true, example = "李四")
    private String driverNameTwo;
    //驾驶员二电话
    @ApiModelProperty(value = "驾驶员二电话", required = true, example = "15845632598")
    private String driverContactNumberTwo;
    //服务开始时间
    @ApiModelProperty(value = "服务开始时间", required = true, example = "2021-07-01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date serviceStartTime;
    //营运类型
    @ApiModelProperty(value = "营运类型", required = true, example = "1100")
    private Integer operateType;
    private String operateTypeName;
    //所属区划
    @ApiModelProperty(value = "所属区划", required = true, example = "420100")
    private Integer cityCode;
    //车辆类型
    @ApiModelProperty(value = "车辆类型", required = true, example = "13")
    private Integer vehicleType;
    private String vehicleTypeName;
    //经营线路
    @ApiModelProperty(value = "经营线路", required = true, example = "全国无固定线路")
    private String businessLine;
    //设备安装时间
    @ApiModelProperty(value = "设备安装时间", required = true, example = "2021-07-01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date equipmentInstallTime;
    //上传平台id
    @ApiModelProperty(value = "上传平台id", required = true, example = "20位数字")
    private List<String> platformIds;
    //上传平台名称
    @ApiModelProperty(value = "上传平台名称", required = true, example = "武汉市运管平台")
    private List<String> platformNames;
    //上传平台标识
    @ApiModelProperty(value = "上传平台标识", required = true, example = "1")
    private List<Integer> tags;





    public JSONObject toJSONString(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONObject object = new JSONObject();
        object.put("numberPlate",numberPlate);
        object.put("plateColor",plateColor);
        object.put("plateColorName",plateColorName);
        object.put("simId",simId);
        object.put("terminalId",terminalId);
        object.put("ownerName",ownerName);
        object.put("contactNumber",contactNumber);
        object.put("ownerSex",ownerSex);
        object.put("ownerSexName",ownerSexName);
        object.put("deviceModel",deviceModel);
        object.put("deviceModelName",deviceModelName);
        object.put("vendorCode",vendorCode);
        object.put("operatorName",operatorName);
        object.put("companyId",companyId);
        object.put("companyName",companyName);
        object.put("driverNameOne",driverNameOne);
        object.put("driverContactNumberOne",driverContactNumberOne);
        object.put("driverNameTwo",driverNameTwo);
        object.put("driverContactNumberTwo",driverContactNumberTwo);
        object.put("serviceStartTime",sdf.format(serviceStartTime));
        object.put("operateType",operateType);
        object.put("operateTypeName",operateTypeName);
        object.put("cityCode",cityCode);
        object.put("vehicleType",vehicleType);
        object.put("vehicleTypeName",vehicleTypeName);
        object.put("businessLine",businessLine);
        object.put("equipmentInstallTime",sdf.format(equipmentInstallTime));
        object.put("platformIds",platformIds);
        object.put("platformNames",platformNames);
        object.put("tags",tags);
        return object;
    }

}
